import React, { useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import * as store from './reducers/partsSlice';
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
import IconButton from '@mui/material/IconButton';
import Tooltip from '@mui/material/Tooltip';
export default function App() {
  const dispatch = useDispatch();
  const show_searchbar=useSelector((state) => state.show_search)
  return (
    <Tooltip title="search result" placement="top">
        <IconButton onClick={()=>{
         dispatch(store.partsSlice.actions.TOGGLE_SEARCH()); 
        }}>{show_searchbar?<KeyboardArrowDownIcon />:<KeyboardArrowUpIcon />}
        </IconButton>
    </Tooltip>
  );
}
